<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>HeadFirst</display-name>
  
  <security-role>
  	<role-name>Admin</role-name>
  </security-role>
  
  <security-role>
  	<role-name>Member</role-name>
  </security-role>
  
  <security-role>
  	<role-name>Guest</role-name>
  </security-role>
  
  <login-config>
  	<auth-method>BASIC</auth-method>
  </login-config>
  <!-- 
  <security-constraint>
  	<web-resource-collection>
  		<web-resource-name>Ch8</web-resource-name>
  		<url-pattern>/ch8/*</url-pattern>
  		
  		<http-method>GET</http-method>
  		<http-method>POST</http-method>
  	</web-resource-collection>
  	<auth-constraint>
		<role-name>Admin</role-name>
		<role-name>Member</role-name>
		<role-name>Guest</role-name>
	</auth-constraint>
  </security-constraint>
   -->
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>
  
  <context-param>
    <param-name>adminEmail</param-name>
    <param-value>context_paramter@qq.com</param-value>
  </context-param>
  
  <context-param>
    <param-name>Name</param-name>
    <param-value>Dylan</param-value>
  </context-param>
  
  <servlet>
    <description></description>
    <display-name>Ch1Servlet</display-name>
    <servlet-name>Ch1Servlet</servlet-name>
    <servlet-class>com.example.ch1.Ch1Servlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>Ch1Servlet</servlet-name>
    <url-pattern>/ch1/date2</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>BeerSelect</display-name>
    <servlet-name>BeerSelect</servlet-name>
    <servlet-class>com.example.ch3.BeerSelect</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>BeerSelect</servlet-name>
    <url-pattern>/ch3/beerSelect.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>BeerSelectWithJSP</display-name>
    <servlet-name>BeerSelectWithJSP</servlet-name>
    <servlet-class>com.example.ch3.BeerSelectWithJSP</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>BeerSelectWithJSP</servlet-name>
    <url-pattern>/ch3/beerSelectWithJSP.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>BeerSelect_ch4</display-name>
    <servlet-name>BeerSelect_ch4</servlet-name>
    <servlet-class>com.example.ch4.BeerSelect</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>BeerSelect_ch4</servlet-name>
    <url-pattern>/ch4/beerSelect.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>DownloadBMP</display-name>
    <servlet-name>DownloadBMP</servlet-name>
    <servlet-class>com.example.ch4.DownloadBMP</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>DownloadBMP</servlet-name>
    <url-pattern>/ch4/bmpGet.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>TestInitParam</display-name>
    <servlet-name>TestInitParam</servlet-name>
    <servlet-class>com.example.ch5.TestInitParam</servlet-class>
    <init-param>
      <param-name>mainEmail</param-name>
      <param-value>mainEmail_servlet_param@qq.com</param-value>
    </init-param>
    <init-param>
      <param-name>adminEmail</param-name>
      <param-value>adminEmail_servlet_param@qq.com</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>TestInitParam</servlet-name>
    <url-pattern>/ch5/Tester.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>TestContextInitParam</display-name>
    <servlet-name>TestContextInitParam</servlet-name>
    <servlet-class>com.example.ch5.TestContextInitParam</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>TestContextInitParam</servlet-name>
    <url-pattern>/ch5/contexInit.do</url-pattern>
  </servlet-mapping>
  
  <listener>
    <listener-class>com.example.ch5.MyServletContextListener</listener-class>
  </listener>
  
  <servlet>
    <description></description>
    <display-name>ListenerTester</display-name>
    <servlet-name>ListenerTester</servlet-name>
    <servlet-class>com.example.ch5.ListenerTester</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>ListenerTester</servlet-name>
    <url-pattern>/ch5/listenTest.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>TestSessionInvalidate</display-name>
    <servlet-name>TestSessionInvalidate</servlet-name>
    <servlet-class>com.example.ch6.TestSessionInvalidate</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>TestSessionInvalidate</servlet-name>
    <url-pattern>/ch6/session01.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>SessionTestLogin</display-name>
    <servlet-name>SessionTestLogin</servlet-name>
    <servlet-class>com.example.ch6.SessionTestLogin</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>SessionTestLogin</servlet-name>
    <url-pattern>/ch6/session02.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>DealWithLogin</display-name>
    <servlet-name>DealWithLogin</servlet-name>
    <servlet-class>com.example.ch6.DealWithLogin</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>DealWithLogin</servlet-name>
    <url-pattern>/ch6/dealWithLogin.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>LoginTest</display-name>
    <servlet-name>LoginTest</servlet-name>
    <servlet-class>com.example.ch6.LoginTest</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>LoginTest</servlet-name>
    <url-pattern>/ch6/dealLogin.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>HobbySelect</display-name>
    <servlet-name>HobbySelect</servlet-name>
    <servlet-class>com.example.ch7.HobbySelect</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>HobbySelect</servlet-name>
    <url-pattern>/ch7/HobbyPage.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <servlet-name>MyJspInitial</servlet-name>
    <jsp-file>/ch7/JspInitial.jsp</jsp-file>
    <init-param>
      <param-name>Name</param-name>
      <param-value>Dylan</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>MyJspInitial</servlet-name>
    <url-pattern>/ch7/MyJspInitial.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>TestJavaBean</display-name>
    <servlet-name>TestJavaBean</servlet-name>
    <servlet-class>com.example.ch8.TestJavaBean</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>TestJavaBean</servlet-name>
    <url-pattern>/ch8/useJavabean.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>PersonDogServlet</display-name>
    <servlet-name>PersonDogServlet</servlet-name>
    <servlet-class>com.example.ch8.PersonDogServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>PersonDogServlet</servlet-name>
    <url-pattern>/ch8/dogName.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>DoRequestServlet</display-name>
    <servlet-name>DoRequestServlet</servlet-name>
    <servlet-class>com.example.ch8.DoRequestServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>DoRequestServlet</servlet-name>
    <url-pattern>/ch8/requestPage.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>RollDickServlet</display-name>
    <servlet-name>RollDickServlet</servlet-name>
    <servlet-class>com.example.ch8.RollDickServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>RollDickServlet</servlet-name>
    <url-pattern>/ch8/rollIt.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>IncludePage</display-name>
    <servlet-name>IncludePage</servlet-name>
    <jsp-file>/ch8/fatherPage.jsp</jsp-file>
  </servlet>
  <servlet-mapping>
    <servlet-name>IncludePage</servlet-name>
    <url-pattern>/ch8/include.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>UerForeachServlet</display-name>
    <servlet-name>UerForeachServlet</servlet-name>
    <servlet-class>com.example.ch9.UerForeachServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>UerForeachServlet</servlet-name>
    <url-pattern>/ch9/forEach.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>ChooseWhenServlet</display-name>
    <servlet-name>ChooseWhenServlet</servlet-name>
    <servlet-class>com.example.ch9.ChooseWhenServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>ChooseWhenServlet</servlet-name>
    <url-pattern>/ch9/choose.do</url-pattern>
  </servlet-mapping>
  
  <servlet>
    <description></description>
    <display-name>SetServlet</display-name>
    <servlet-name>SetServlet</servlet-name>
    <servlet-class>com.example.ch9.SetServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>SetServlet</servlet-name>
    <url-pattern>/ch9/set.do</url-pattern>
  </servlet-mapping>  
  
  <servlet>
      <servlet-name>FrontController</servlet-name>
      <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
      <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
      <servlet-name>FrontController</servlet-name>
      <url-pattern>*.do</url-pattern>
  </servlet-mapping>
</web-app>